function bubbleSort(arr){
    let len = arr.length;
    for (let i = 0; i < len - 1; i++){
        for (let j = 0; j < len - i - 1; j++){
            let temp;
            if (arr[j] > arr[j + 1]){
                temp = arr[j];
                arr[j] = arr[j + 1];
                arr[j + 1] = temp;
            }
        }
    }
    return arr;
}

let arr = bubbleSort([12, 3, 42, 32, 213, 2, 3, 41, 232, 34, 54, 657, 67]);

console.log(arr)